import { IFeidaoAiMobile } from '@dfeidao/mobile/interfaces';
import React from 'react';
import { ActivityIndicator, Text, View } from 'react-native';
import { Image } from 'react-native-elements';

export default function tpl(a: (action: string, ...args: unknown[]) => ((...args: unknown[]) => void), s: (...class_names: string[]) => {}, d: (d: string) => string | number | unknown, fd: IFeidaoAiMobile) {
	const headimg = d('headimg') as string;
	const loading = d('loading') as string;
	if (loading === '1') {
		return (
			<View style={{ padding: 10 }}>
				<View style={{ flexDirection: 'row', borderBottomWidth: 1, borderColor: '#ddd' }}>
					<View style={{ flex: 1 }}>
						<Image source={headimg ? { uri: headimg } : require('../../imgs/nan.jpg')} style={s('img1')} PlaceholderContent={<ActivityIndicator />} />
						<Text style={s('text1')}>
							学生正面照
					</Text>
					</View>
					<View style={{ flex: 1 }}>
						<Text onPress={a('a002', d('student_no'))} style={s('th')}>替换照片</Text>
					</View>
					<View style={{ flex: 1 }}>
						<Image source={require('../../imgs/shouye.png')} style={s('img1')}></Image>
						<Text style={s('text1')}>
							示例图片
					</Text>
					</View>
				</View>
			</View>
		);
	} else {
		return (<View style={s('footer1')}>
			<ActivityIndicator
				animating={true}
				color='blue'
				size="large"
			/>
		</View>);
	}
}
